<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <!-- 
    机箱
      主板
        cpu
        gpu
        内存条
        硬盘



   -->
  <div id="app">
    <jixiang></jixiang>
  </div>
  <script src="./vue.js"></script>
  <script>
    // 养成习惯把组件配置对象单独创建
    const cpu = {
      template: `
        <div class="cpu"></div>
      `
    }
    
    const gpu = {
      template: `
        <div class="gpu"></div>
      `
    }

    const nct = {
      template: `
        <div class="nct"></div>  
      `
    }

    const yp = {
      template: `
        <div class="yp"></div>
      `
    }

    const zhuban = {
      template: `
        <div class="zhuban">
          <cpu></cpu>
          <gpu></gpu>
          <nct></nct>
          <yp></yp>
        </div>
      `,
      components: {
        cpu, gpu, nct, yp
      }
    }

    const jixiang = {
      template: `
        <div class="jixiang">
          <zhuban></zhuban>
        </div>
      `,
      components: {
        zhuban
      }
    }

    

    const app = new Vue({
      el: '#app',
      data: {},
      // 注册机箱
      components: {
        jixiang
      }
    })
    
  </script>
</body>
</html>